<div class="blazorise-codeblock">
<div class="html"><pre>
<span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">Button</span> <span class="htmlAttributeName">Color</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="enum">Color</span><span class="enumValue">.Primary</span><span class="quot">&quot;</span> <span class="htmlAttributeName">Clicked</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="sharpVariable"><span class="atSign">&#64;</span>ShowInfoMessage</span><span class="quot">&quot;</span><span class="htmlTagDelimiter">&gt;</span>Say hi!<span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">Button</span><span class="htmlTagDelimiter">&gt;</span>
<span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">Button</span> <span class="htmlAttributeName">Color</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="enum">Color</span><span class="enumValue">.Danger</span><span class="quot">&quot;</span> <span class="htmlAttributeName">Clicked</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="sharpVariable"><span class="atSign">&#64;</span>ShowConfirmMessage</span><span class="quot">&quot;</span><span class="htmlTagDelimiter">&gt;</span>Confirm<span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">Button</span><span class="htmlTagDelimiter">&gt;</span>
</pre></div>
<div class="csharp"><pre>
<span class="atSign">&#64;</span>code{
    [Inject] IMessageService MessageService { <span class="keyword">get</span>; <span class="keyword">set</span>; }

    Task ShowInfoMessage()
    {
        <span class="keyword">return</span> MessageService.Info( <span class="string">&quot;This is a simple info message!&quot;</span>, <span class="string">&quot;Hello&quot;</span> );
    }

    <span class="keyword">async</span> Task ShowConfirmMessage()
    {
        <span class="keyword">if</span> ( <span class="keyword">await</span> MessageService.Confirm( <span class="string">&quot;Are you sure you want to confirm?&quot;</span>, <span class="string">&quot;Confirmation&quot;</span> ) )
        {
            Console.WriteLine( <span class="string">&quot;OK Clicked&quot;</span> );
        }
        <span class="keyword">else</span>
        {
            Console.WriteLine( <span class="string">&quot;Cancel Clicked&quot;</span> );
        }
    }
}
</pre></div>
</div>
